#设计表格（设计类）——生产表格（创建对象）——打印表格（对象赋值）
#类中定义的函数称为方法，外面定义的函数称为函数

class personal_registration_form:
    name = None
    age = None
    gender = None
    nationality = None
    nation_place = None
    #------------------在类中定义成员方法，必须加形参“self”，类外面调用时不用传具体的参数
    def say_hi(self):
        print(f"Hello, {self.name}")#------在成员方法中调用成员变量需要用self.成员变量

stu_1 = personal_registration_form()

stu_1.name = "冯家睿"
stu_1.age = 21
stu_1.gender = "男"
stu_1.nationality = "China"
stu_1.nation_place = "Cichuan"

print(f"{stu_1.name} {stu_1.age} {stu_1.gender} {stu_1.nationality} {stu_1.nation_place}")
print(f"{stu_1.say_hi()}")
 
#-------------------构造方法(__init__(self):),作用成员变量的初始化---------------------
class Student:
    # name = None
    # age = None
    # tle = None

    def __init__(self, name, age, tle):
        self.name = name
        self.age = age
        self.tle = tle
        print(f"Hello, {self.name}, 你的年龄是{self.age}, 电话号码为{self.tle}")

stu = Student(name="张学油", age = 47, tle = "18323418186")

#----------------------------------------------------------------------------------
class Student:
    name = None
    age = None
    address = None

    #创建构造方法
    def __init__(self, name, age, address):
        self.name = name
        self.age = age
        self.address = address
        print(f",信息为：【学生姓名：{self.name}, 年龄：{self.age}, 地址：{self.address}】")

for i in range(3):
    
    name = input("请输入姓名:")
    age = input("请输入年龄:")
    address = input("请输入学生地址:")
    print(f"学生{i + 1}信息录入完成", end="")
    Student(name, age, address)